﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model;
namespace FG_Skiing_DAL
{
   public class Tickets_dal
    {
       FGSkiingEntities entity = new FGSkiingEntities();//数据上下文
       /// <summary>
       /// 票务显示
       /// </summary>
       /// <returns></returns>
       public List<Tickets> Tickets_Show()
       {
           return entity.Tickets.OrderBy(p => p.Tickets_ID).ToList();
       }
       /// <summary>
       /// 添加订单
       /// </summary>
       /// <param name="Add"></param>
       /// <returns></returns>
       public bool AddTickets(Tickets add)
       {
           entity.Tickets.Add(add);
           return entity.SaveChanges() > 0;
       }
       /// <summary>
       /// 评论显示
       /// </summary>
       /// <returns></returns>
       public List<Users_Comment> Comment_Show()
       {
           return entity.Users_Comment.OrderBy(p => p.Users_Comment_ID).ToList();
       }
    }
}
